package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HyUserFavoriteMapper;
import com.ruoyi.system.domain.HyUserFavorite;
import com.ruoyi.system.service.IHyUserFavoriteService;

/**
 * 用户收藏Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-23
 */
@Service
public class HyUserFavoriteServiceImpl implements IHyUserFavoriteService 
{
    @Autowired
    private HyUserFavoriteMapper hyUserFavoriteMapper;

    /**
     * 查询用户收藏
     * 
     * @param favoritesId 用户收藏主键
     * @return 用户收藏
     */
    @Override
    public HyUserFavorite selectHyUserFavoriteByFavoritesId(Long favoritesId)
    {
        return hyUserFavoriteMapper.selectHyUserFavoriteByFavoritesId(favoritesId);
    }

    /**
     * 查询用户收藏列表
     * 
     * @param hyUserFavorite 用户收藏
     * @return 用户收藏
     */
    @Override
    public List<HyUserFavorite> selectHyUserFavoriteList(HyUserFavorite hyUserFavorite)
    {
        return hyUserFavoriteMapper.selectHyUserFavoriteList(hyUserFavorite);
    }

    /**
     * 新增用户收藏
     * 
     * @param hyUserFavorite 用户收藏
     * @return 结果
     */
    @Override
    public int insertHyUserFavorite(HyUserFavorite hyUserFavorite)
    {
        return hyUserFavoriteMapper.insertHyUserFavorite(hyUserFavorite);
    }

    /**
     * 修改用户收藏
     * 
     * @param hyUserFavorite 用户收藏
     * @return 结果
     */
    @Override
    public int updateHyUserFavorite(HyUserFavorite hyUserFavorite)
    {
        return hyUserFavoriteMapper.updateHyUserFavorite(hyUserFavorite);
    }

    /**
     * 批量删除用户收藏
     * 
     * @param favoritesIds 需要删除的用户收藏主键
     * @return 结果
     */
    @Override
    public int deleteHyUserFavoriteByFavoritesIds(Long[] favoritesIds)
    {
        return hyUserFavoriteMapper.deleteHyUserFavoriteByFavoritesIds(favoritesIds);
    }

    /**
     * 删除用户收藏信息
     * 
     * @param favoritesId 用户收藏主键
     * @return 结果
     */
    @Override
    public int deleteHyUserFavoriteByFavoritesId(Long favoritesId)
    {
        return hyUserFavoriteMapper.deleteHyUserFavoriteByFavoritesId(favoritesId);
    }
}
